#ifndef __POST_PROCESS_H__
#define __POST_PROCESS_H__

#include "slotsData/ImageProperties.h"
#include "../glutil/FBO.h"
#include "../glutil/EffectsPass.h"

class PostProcess
{
	public:
		PostProcess(int widgetWidth, int widgetHeight);
		~PostProcess();
		void widgetResized(int width, int height);
		void setImageProperties(const slotsdata::ImageProperties &properties);

		void beginCapture();
		void endCapture();

		void doPostProcess();

	private:
		int m_viewportWidth;
		int m_viewportHeight;
		slotsdata::ImageProperties m_properties;

		glutil::FBO m_mainFBO;
		glutil::FBO m_hblurFBO; // also used for rays
		glutil::FBO m_vblurFBO;

		glutil::EffectsPass * m_hblurPass;
		glutil::EffectsPass * m_vblurPass;
		glutil::EffectsPass * m_raysPass;
		glutil::EffectsPass * m_finalPass;

		glutil::ShaderProgram * m_hblurShader;
		glutil::ShaderProgram * m_vblurShader;
		glutil::ShaderProgram * m_raysShader;
		glutil::ShaderProgram * m_finalShader;
};

#endif

